function getByPid(pid, callback) {
    if (Array.isArray(pid)) {
        let urls = pid.map(a => axios.get(`http://localhost:3000/plist?pid=${a}`));
        axios.all(urls).then(res => callback(res.map(x => x.data[0])))
    } else {
        axios.get(`http://localhost:3000/plist?pid=${pid}`)
            .then(res => callback(res.data[0]))
    }

}

function getByKey(key, callback) {
    axios.get(`http://localhost:3000/plist?${key}`)
        .then(res => callback(res.data))
}
export default {
    getByPid,
    getByKey
}